import React from 'react'
import RouterView from '../router/index2'
import { NavLink } from 'react-router-dom'

export default function Home({ children }) {
    return (
        <div className='home'>
            <main>
                <RouterView routes={children} />
            </main>

            <footer>
                {
                    children.filter(item => !item.redirect).map((item, index) => {
                        // activeClassName  active类名被占用的时候使用
                        return <NavLink to={item.path} key={index}>
                            {item.title}
                        </NavLink>
                    })
                }
            </footer>
            {/* <RouterView routes = { children }/> */}
        </div>
    )
}
